<?php
global  $auth;
if 
($_SESSION['uip']==$ip && $_SESSION['uagent']==$agent && $_COOKIE['usid']==$_SESSION['usid']) 
{$auth='1';};
echo $auth;
echo '<br />';
echo $_SESSION['uip'],'-',$ip;
echo '<br />';
echo $_SESSION['uagent'],'-',$agent;
echo '<br />';
echo $_COOKIE['usid'],'-',$_SESSION['usid'];
echo '<br />';
if ($auth=='1') {echo 'авторизован';} else { echo 'фига';}
?>